package com.matt.foundation.vo.course;

import com.matt.domain.course.CourseTopic;
import com.matt.foundation.DO.CoursePlanNurseryClassesDo;
import com.matt.foundation.DO.StaffAreaDO;
import lombok.Data;

import java.util.List;
import java.util.stream.Collectors;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/3/13
 * *******************************
 */
@Data
public class PadCoursePlanNurseryListVo {
    private String classesCoursePlanId;
    private String coursePlanId;
    private String topicName;
    private String typeName;
    private String courseName;
    private String classesName;
    private Long courseDate;
    private Long beginTime;
    private Long endTime;
    private Integer prepareStatus=0;
    private Integer courseStatus=0;
    private String teacherName;
    private List<String> otherTeachers;

    public static PadCoursePlanNurseryListVo of(CoursePlanNurseryClassesDo nursery, String classesName, String teacherName, List<StaffAreaDO> names, CourseTopic topic){
        PadCoursePlanNurseryListVo vo = new PadCoursePlanNurseryListVo();
        vo.setClassesCoursePlanId(nursery.getClassesCoursePlanId());
        vo.setCoursePlanId(nursery.getCoursePlanNurseryId());
        vo.setTopicName(topic.getName());
        vo.setTypeName(nursery.getTypeName());
        vo.setCourseName(nursery.getCourseName());
        vo.setClassesName(classesName);
        vo.setCourseDate(nursery.getCourseDate().getTime());
        vo.setBeginTime(nursery.getBeginTime().getTime());
        vo.setEndTime(nursery.getEndTime().getTime());
        vo.setTeacherName(teacherName);
        vo.setPrepareStatus(nursery.getPrepareStatus());
        vo.setCourseStatus(nursery.getCourseStatus());
        vo.setOtherTeachers(names.stream().map(o->o.getRealName()).collect(Collectors.toList()));
        return vo;
    }
}
